package com.jackchan.homework.sysw.entity;

import com.jackchan.homework.common.IdEntity;
import com.jackchan.homework.system.entity.User;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by ch-hui on 15/12/26.
 */
@Entity
@Table(name = "t_recipe_needs")
public class RecipeNeeds extends IdEntity {

    // 标准名称
    private String name;

    // 创建时间
    private Date createTime;

    // 创建人
    private User createUser;

    // 标准描述
    private String recipeMarks;

    // 标准状态 0-实验研究 1-投入生产
    private Integer status = 0;

    // 标准来源
    private String recipeSource;

    // 使用对象
    private String useObject;

    // 饲养阶段
    private String stage;

    private Material templateMaterial;


    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @ManyToOne
    @JoinColumn(name = "create_user_id", referencedColumnName = "id")
    public User getCreateUser() {
        return createUser;
    }

    public void setCreateUser(User createUser) {
        this.createUser = createUser;
    }

    @Column(name = "marks")
    public String getRecipeMarks() {
        return recipeMarks;
    }

    public void setRecipeMarks(String recipeMarks) {
        this.recipeMarks = recipeMarks;
    }

    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Column(name = "source")
    public String getRecipeSource() {
        return recipeSource;
    }

    public void setRecipeSource(String recipeSource) {
        this.recipeSource = recipeSource;
    }

    @Column(name = "use_object")
    public String getUseObject() {
        return useObject;
    }

    public void setUseObject(String useObject) {
        this.useObject = useObject;
    }

    @Column(name = "stage")
    public String getStage() {
        return stage;
    }

    public void setStage(String stage) {
        this.stage = stage;
    }


    @ManyToOne
    @JoinColumn(name = "template_material_id", referencedColumnName = "id")
    public Material getTemplateMaterial() {
        return templateMaterial;
    }

    public void setTemplateMaterial(Material templateMaterial) {
        this.templateMaterial = templateMaterial;
    }
}
